package com.ztk.threadbasic.threadlocal;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

@RestController
@RequestMapping("/threadlocal04")
public class ThreadLocal04 {


    @RequestMapping("/setValue")
    public void setValue() {
        ThreadLocal<Byte[]> threadLocal = new ThreadLocal<>();
        System.out.println(threadLocal);
        // 每一次请求都会往threadlocal中创建一个5M的数组
        threadLocal.set(new Byte[1024*1024*5]);
        System.out.println("创建完毕");
    }
}

